const Router = require('koa-router')()
const chart = require('../control/chart')
/**
 * @api {get} /chart/getHomeData 获取首页数据
 * @apiName getHomeData
 * @apiGroup chart
 * @apiDescription 获取首页数据
 * 
 * @apiHeaderExample {json} Header:
 * {
 *    "Authorition": "Bearer xxxxxxxxxxxx(登陆时获取的token)"
 *  }
 *
 * @apiSuccessExample 成功
 * {
    "code": 1,
    "data": {
      number: [],
      course: []
  }
 *
 */
Router.get('/getHomeData', chart.getHomeData)
/**
 * @api {post} /chart/getScore 获取学生成绩
 * @apiName getScore
 * @apiGroup getScore
 * @apiDescription 获取学生成绩
 * @apiParam (params) {String} course 课程id
 * @apiHeaderExample {json} Header:
 * {
 *    "Authorition": "Bearer xxxxxxxxxxxx(登陆时获取的token)"
 *  }
 *
 * @apiSuccessExample 成功
 * {
    "code": 1,
    "data": {
      scoreLists: []
  }
 *
 */
Router.post('/getScore', chart.getScore)

module.exports = Router
